package com.pivotal.cloud.crypto.keygen;

import com.pivotal.cloud.crypto.codec.Hex;

/**
 * @className: com.pivotal.cloud.security.crypto.keygen.HexEncodingStringKeyGenerator
 * @projectName: 项目
 * @module: 项目-HexEncodingStringKeyGenerator类，主要位于模块
 * @content:
 * @author: Powered by Marklin
 * @datetime: 2025-06-24 15:18
 * @version:
 * @copyright: Copyright © 2018-2025 Systems Incorporated. All rights reserved.
 */
public final class HexEncodingStringKeyGenerator implements StringKeyGenerator {

	private final BytesKeyGenerator keyGenerator;

	public HexEncodingStringKeyGenerator(BytesKeyGenerator keyGenerator) {
		this.keyGenerator = keyGenerator;
	}

	@Override
	public String generateKey() {
		return new String(Hex.encode(this.keyGenerator.generateKey()));
	}

}
